package com.carey.blog.sync;

import java.net.URL;
import java.util.List;

/**
 * Blog.
 * 
 */
public interface Blog {

	/**
	 * Gets blogging service provider.
	 * 
	 * @return blogging service provider, such as
	 *         {@linkplain com.carey.blog.model.BlogSync#BLOG_SYNC_CSDN_BLOG}.
	 */
	String getBloggingServiceProvider();

	/**
	 * Sets the user name with the specified user name.
	 * 
	 * @param userName
	 *            the specified user name
	 */
	void setUserName(final String userName);

	/**
	 * Sets the user password with the specified user password.
	 * 
	 * @param userPassword
	 *            the specified user password
	 */
	void setUserPassword(final String userPassword);

	/**
	 * Gets the user name of this blog.
	 * 
	 * @return user name
	 */
	String getUserName();

	/**
	 * Gets the user password of this blog.
	 * 
	 * @return user password
	 */
	String getUserPassword();

	/**
	 * Gets the archive web page URL by the specified archive date.
	 * 
	 * @param archiveDate
	 *            the specified archive date(yyyy/MM)
	 * @return archive web page URL, returns {@code null} if occurs error or not
	 *         found
	 */
	URL getArchivePageURL(final String archiveDate);

	/**
	 * Gets the index web page URL.
	 * 
	 * @return index web page URL, returns {@code null} if occurs error or not
	 *         found
	 */
	URL getIndexPageURL();

	/**
	 * Gets the all archive dates.
	 * 
	 * @return a set of archive dates(yyyy/MM), returns an empty set if not
	 *         found any archive date
	 */
	List<String> getArchiveDates();

	/**
	 * Gets article ids by the specified archive date.
	 * 
	 * @param archiveDate
	 *            the specified archive date(yyyy/MM)
	 * @return a set of article ids, returns an empty list if not found
	 */
	List<String> getArticleIdsByArchiveDate(final String archiveDate);
}
